<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
class Common extends Controller
{
	//保存管理员数据的变量
	public $info = array();

	public function __construct()
    {
    	parent::__construct();
    	$agent = $_SERVER['HTTP_USER_AGENT'];

        if(strpos($agent,'MicroMessenger')){
		  	//echo '微信浏览器';
		}

		if(strpos($agent,'QQ')){
			//echo 'qq浏览器';
		}

		if(strpos($agent,'Weibo')){
			//echo '微博浏览器';
		}

    	$this->info = session("info");

    	$bid=input("bid");

    	if(!empty($bid)){
    		session("bid", $bid);
    	}
    	
		if(empty($this->info)){
			$this->redirect("Login/login");
		}
    }
}